package org.ns.summer.beans;

import org.ns.summer.beans.error.BeansException;

/**
 * Bean 实例工厂，IOC容器的超类
 */
public interface BeanFactory {

    String FACTORY_BEAN_PREFIX = "&"; // 工厂BEAN前缀，getBean("$beanname");得到创建这个bean的工厂实例

    // 获得 Bean
    Object getBean(String name) throws BeansException;

    boolean containsBean(String name); // 是否存在

    // String[] getAliases(String name);

    <T> T getBean(String name, Class<T> requiredType) throws BeansException;

    public <T> T getBean(Class<T> requiredType) throws BeansException ;
}
